<link	href="${rc.getContextPath()}/manage/css/dwzCustomCss/dwz.custom.css?v=${ver}"
	rel="stylesheet" type="text/css">
<style>
.tree .workUnit a {
	color: #4C9ED9;
}
.pageContent > div.andonConfigMain {
    float: left; 
    display: block; 
    min-height: 550px; 
    min-width: 900px; 
    width: 100%; 
    height: 100%; 
    position: relative;
    overflow: hidden;
}
.andonConfigtable {	
    background: #fff; 
    border-top:1px #d8dfe5 solid; 
    border-bottom: 1px #d8dfe5 solid;
    border-left: 1px #d8dfe5 solid;
    border-right: 1px #d8dfe5 solid
}

.andonConfigcustomp p{
    margin-left: 10px;
    margin-top: 3px;
    padding-left: 10px;
    height: 30px;
}
</style>
<div class="pageContent" style="height: 100%;">
	<div class="andonConfigMain">	
		<div class="treeleft" style="width: 280px; float: left; border-right: 1px solid #D8DFE5;">
			<div class="mini-toolbar">
				<input type="text" id="workcenterSearch" /> <a class="buttonActive"
					href="javascript:void(0)" id="searchTree"> <span><@label
						key='search.B'>搜索</@label></span>
				</a>
			</div>
			<div id="menuBar" class="pBar pBarBorder">
				<ul class="toolBar">
					<li><a class="collapse" id="collapsable"
						title='<@label key="collapseAll.D">全部收起</@label>'> <span><@label
								key="collapse.B">收起</@label></span>
					</a></li>
					<li><a class="expand" id="expandable"
						title='<@label key="expandAll.D">全部展开</@label>'> <span><@label
								key="expand.B">展开</@label></span>
					</a></li>
				</ul>
			</div>
			<div id="workcenterTree" layoutH="68">
				<#if workCentersTree??>
				<ul class="tree treeFolder expand"><@macroWorkCenterTree
					children=workCentersTree />
				</ul>
				</#if>
			</div>
			<!-- 递归产生树的宏定义 -->
			<#macro macroWorkCenterTree children> <#if children?? && children?size
			gt 0> <#list children as workCenter>
			<li class='workCenter'
				workcenterCode="${workCenter.workCenterCode!''}"><a
				onclick="$(this).trigger('check');" title="工作中心">${workCenter.workCenterText!''}</a>
				<#if workCenter.childrens?? || workCenter.workUnits?size gt 0>
				<ul>
					<@macroWorkCenterTree children=workCenter.childrens /> <#list
					workCenter.workUnits as workUnit>
					<li class="workUnit" workunitCode="${workUnit.workUnitCode!''}">
						<a onclick="$(this).trigger('check');" title="作业单元">${workUnit.workUnitText!''}</a>
					</li> </#list>
				</ul> </#if></li> </#list> </#if> </#macro>
		</div>
		<div style="margin-left: 281px;" class="pageContent" id="andonConfigRight" >
			
			<div class="andonConfigRightTop" layoutH="300">			
				<div id="jGridAndonType" class="andonConfigtable" style="width: 28%;float: left; height: 98%; overflow:auto">
		        	<table id="andonTypeTable" class="table" style="width: 100%;" >
		                <thead>
		                    <tr>
		                        <th width="50"><@label key="andonTypeCode.C">安灯类型编号</@label></th>
		                        <th width="50"><@label key="andonTypeText.C">安灯类型描述</@label></th>
		                    </tr>
		                </thead>
		                <tbody>
		                	 <#if andonTypes??><#list andonTypes as andonType>
		                	 <tr  id="${andonType.andonTypeCode!''}" onclick='workJs._showMaterial(this);'>
		                	 	 <td>${andonType.andonTypeCode!''}</td>
		                		 <td>${andonType.typeText!''}</td>  
		                	 </tr>
		                	 </#list> 
		                	 <#else>
			                 <tr>
				                <td colspan="7"  class="noData">======<@label key="noListData.C">列表无数据</@label>=====
				                </td>
				             </tr>
				             </#if>
		                </tbody>
		            </table>
		        </div>
		        
		        <div id="jGridAndonAccount"  class="andonConfigtable" style="float: left;width: 68%;height: 98%; overflow:auto" >
				 	<div class="panelBar">
				         <ul class="toolBar">
				             <li><a class="add" onclick='workJs._addToMaterial();'><span><@label key="addTo.B">添加</@label></span></a></li>
				             <li><a class="delete" onclick='workJs._cancelSelect();'><span><@label key="cancelSelect.B">取消选择</@label></span></a></li>
				         </ul>
				    </div>
				    <table id="materialTable" class="table" style="width: 100%;">
				          <thead>
				              <tr>
				              	  <th width="1"><input type="checkbox" name="quanxuan" group="codes" class="checkboxCtrl"></th>
				              	  <th width="15"><@label key="andonCode.C">安灯编号</@label></th>
				              	  <th width="15"><@label key="andonText.C">安灯描述</@label></th>
				                  <th width="50"><@label key="materialCode.C">物料编号</@label></th>
				                  <th width="50"><@label key="materialText.C">物料描述</@label></th>
				                  <th width="70"><@label key="memo.C">备注</@label></th>                        
				              </tr>
				          </thead>
				          <tbody>
				          </tbody>
				    </table>     	       	
				 </div>
				 
			</div>
			<div style="height: 300px;">
				<form method="post"  id=andonConfigForm name="andonConfigForm" action="${rc.getContextPath()}/manage/andonConfig/saveAndonConfig"  onsubmit="return validateCallback(this,dialogAjaxDone);" >
				<div id="jGridConfigMaterial" class="andonConfigtable" style="float: left;width: 53%;height: 250px;overflow:auto" >
					<div class="panelBar">
			            <ul class="toolBar">
			                <li><a class="add" onclick='workJs._deleteMaterial();'><span><@label key="delete.B">删除</@label></span></a></li>
			            	<li><a class="delete" onclick='workJs._clearAll();'><span><@label key="clear.C">清空</@label></span></a></li>
			            </ul>
			        </div>
			        <input type="hidden" name="navTabId" value="${navTabId!''}">
			    	<table id="configMaterialTable" class="table" style="width: 100%;">
						<thead>
						    <tr>
						    	  <th width="1"><input type="checkbox" name="mquanxuan" group="mcodes" class="checkboxCtrl"></th>
						          <th width="15"><@label key="andonCode.C">安灯编号</@label></th>
				              	  <th width="15"><@label key="andonText.C">安灯描述</@label></th>
				                  <th width="50"><@label key="materialCode.C">物料编号</@label></th>
				                  <th width="50"><@label key="materialText.C">物料描述</@label></th>
				                  <th width="70"><@label key="memo.C">备注</@label></th>      
						    </tr>
						</thead>
						<tbody>
						</tbody>
		    		</table>   
				</div>
				
				<div id="jGridWorkCenterConfigure" class="andonConfigtable" style="float: left;width: 43%; height: 250px;"  >
					<div class="andonConfigcustomp">      						 	
					 	<p>	
					 		<label>
						  		<input style="margin-right: 2px;" type="checkbox" name="triggerMateriaLreqFlag" >
						  		<@label key="triggerMateriaLreqFlag.C">触发物料需求标记</@label>
					 		</label>
					      	<label style="padding-left: 20px;">
					 			<input style="margin-right: 2px;" type="checkbox" name="usemmConfigFlag"  >	
					 			<@label key="usemmConfigFlag.C">采用物流模块配置标记</@label>
							</label>				                          
					 	</p>
					 	<p>
					 		<label><@label key='requirementType.C,colon'>需求类型：</@label></label> 
					 		<input type="text" name="reqType" id="reqType" maxlength="20"/>
					 	</p>
					 	<p class="andonConfignotnormal">				 	
					 		<label style="float: left; padding-right: 3px;"><@label key='requirementQuantity.C,colon'>需求数量：</@label></label> 
					 		<input style="float: left; " type="text" name="reqQuantity" class="required number" maxlength="7"/>
					 	</p>						 					 	
				 		<table id="andonTable" class="table" style="float: left;width: 100%; height: 100%;" >
				      		<thead>
					            <tr>
					                <th width="100"><@label key='enableSelect.C'>启用选择</@label></th>
					                <th width="100"><@label key='dateMin.C'>时间（MIN）</@label></th>
					                <th width="100"><@label key='messageCode.C'>消息编号</@label></th>
					            </tr>
				        	</thead>
				        	<tbody>
				        		<tr>
				        			<td>
				        				<input style="margin-right: 2px;" type="checkbox" name="notify1Flag"  >	
				 						<@label key="notifyFlag.C,1">通知启用标志1：</@label>	 
				        			</td>
				        			<td>
				        				<input type="text" style="width: 80px;" name="notify1Time" class="digits"  maxlength="7"/>
				        			</td>
				        			<td>
				        				<input type="text" class="alphanumeric toUp" style="width: 80px;" name="notify1Messagecode" maxlength="20"/>      
				        			</td>
				        		</tr>
				        		<tr>
				        			<td>
				        				<input style="margin-right: 2px;" type="checkbox" name="notify2Flag"  >	
				 						<@label key="notifyFlag.C,2">通知启用标志2：</@label>	 
				        			</td>
				        			<td>
				        				<input type="text" style="width: 80px;" name="notify2Time" class="digits"  maxlength="7"/>
				        			</td>
				        			<td>
				        				<input type="text" class="alphanumeric toUp" style="width: 80px;"  name="notify2Messagecode" maxlength="20"/>      
				        			</td>
				        		</tr>
				        		<tr>
				        			<td>
				        				<input style="margin-right: 2px;" type="checkbox" name="notify3Flag"  >	
				 						<@label key="notifyFlag.C,3">通知启用标志3：</@label>	 
				        			</td>
				        			<td>
				        				<input type="text" style="width: 80px;"  name="notify3Time" class="digits"  maxlength="7"/>
				        			</td>
				        			<td>
				        				<input type="text" class="alphanumeric toUp" style="width: 80px;"  name="notify3Messagecode" maxlength="20"/>      
				        			</td>
				        		</tr>
				        		<tr>
				        			<td>
				        				<input style="margin-right: 2px;" type="checkbox" name="notify4Flag"  >	
				 						<@label key="notifyFlag.C,4">通知启用标志4：</@label>	 
				        			</td>
				        			<td>
				        				<input type="text" style="width: 80px;"  name="notify4Time" class="digits"  maxlength="7"/>
				        			</td>
				        			<td>
				        				<input type="text"  class="alphanumeric toUp" style="width: 80px;" name="notify4Messagecode" maxlength="20"/>      
				        			</td>
				        		</tr>
				        		<tr>
				        			<td>
				        				<input style="margin-right: 2px;" type="checkbox" name="notify5Flag" >	
				 						<@label key="notifyFlag.C,5">通知启用标志5：</@label>	 
				        			</td>
				        			<td>
				        				<input type="text" style="width: 80px;"  name="notify5Time" class="digits"  maxlength="7"/>
				        			</td>
				        			<td>
				        				<input type="text" class="alphanumeric toUp" style="width: 80px;"	 name="notify5Messagecode" maxlength="20"/>      
				        			</td>
				        		</tr>
				        	</tbody>
				  		</table> 
				 	</div>
				 </div>
			
				<div style="float:left; padding-left: 45%;padding-top: 15px;height: 20px">						
					<div class="buttonActive" id="AndonConfig_save" >
			             <div class="buttonContent" >
			                 <button type="button" onclick='workJs._submitAndonConfigs();'><@label key="save.B">保存</@label></button>
			             </div>
			         </div>
				</div>	
				</form>			
			</div>
		</div>
	</div>
</div>
<script type="text/javascript">
	var $page = DWZ.context(), postData = {},andonConfig,andonCode="";
	var andonConfigMap = new Map();
	$(function(){
		$("#searchTree", $page).baseTreeSearch({
	        inputTextId: "#workcenterSearch",
	        alertMsg: "<@label key='Tree_search_Input.D'>输入名称进行查询</@label>", 
	        $p: $page
	    });
	    
	    $("#collapsable", $page)._treeCollapsable({
	        $p: $page
	    })
	    
	    $("#expandable", $page)._treeExpandable({
	        $p: $page
	    });
	    
	    $('#workcenterTree .tree', $page).on('check', '.workCenter, .workUnit', function(event) {
			var $this = $(this);
			postData = {};
			if ($this.is('.workCenter')) {
				postData.code = $(this).attr('workcenterCode');
				postData.type = 'workCenter';
			} else if ($this.is('.workUnit')) {
				postData.code = $(this).attr('workunitCode');
				postData.type = 'workUnit';
			}		
			$.DWZajax({
                url:hostUrl +"/andonConfig/getAndonConfig",
                data:{
                	'code':postData.code,
                	"type":postData.type},
                callback:function(data){
                	workJs._clear();
            		andonConfigMap.clear();
                	if(data && data.length > 0){                		
                		for(var i=0; i<data.length; i++){                			
                			andonConfigMap.put(data[i].andonCode,data[i]);                    			 
                        }                		
                	}
                	workJs._addconfigMaterialTable();
                }
            });			
			return false;
		});
	    
	    $("input[name='usemmConfigFlag']", $page).click(function(){
	    	if(andonCode){
	    		if($(this).is(':checked')){
	    			$.DWZajax({
	                    url:hostUrl +"/pfep/getDistributionQuantityByMaterialCode",
	                    data:{'materialCode':andonConfigMap.get(andonCode).materialCode},
	                    callback:function(data){
	                    	if(data){
	                    		$("input[name='reqQuantity']",$page).val(data);
	                    	}	                    	
	                    }
	                });
	    	    }	    		
	    	}
	    	
	    });
	});
	
	var workJs = {
		_submitAndonConfigs : function(){	
			if(!andonConfigMap)
                return;	
			if(!postData.type){
        		alertMsg.error("<@label key='selectWorkCenterOrWorkUnit.M'>请先选择工作中心或者作业单元！</@label>");
        		return;
        	}	
			if(andonConfigMap.size()!=0){
				var $form =$("#andonConfigForm", $page);
	            if (!$form.valid()) {
	                return false;
	            }
			}			
            workJs._changeconfigUre();
        	var keys = andonConfigMap.keys();
			for(var i=0; i<keys.length; i++){
				var andonConfig =andonConfigMap.get(keys[i]);
				if(!andonConfig.reqQuantity){
					alertMsg.error("<@label key='pleaseANDON.M,colon'>请输入ANDON</@label>"+andonConfig.andonCode+"<@label key='requirementQuantity.C'>需求数量</@label>");
					return;	
				};    							
			}           	
            $.DWZajax({
                url:hostUrl +"/andonConfig/saveAndonConfig",
                data:{
                	'navTabId':$("input[name='navTabId']",$page).val(),
                	'andonConfigs':JSON.stringify(andonConfigMap),
                	'type':postData.type,
                	'workUnitCode':postData.code,
                	'workCenterCode':postData.code},
                callback:function(data){
                	if(!data){
                		alertMsg.error(data);
                	}
                	alertMsg.correct("<@label key='successfulOperation.M'>操作成功</@label>");                   	
                }
            });
		},
		_addconfigMaterialTable : function(){	
			if(!andonConfigMap)
                return;	
			var keys = andonConfigMap.keys();
			for(var i=0; i<keys.length; i++){
				var andonConfig =andonConfigMap.get(keys[i]);
				if(i==0){
					workJs._showconfigUre(keys[i]);
					andonCode=andonConfig.andonCode;
				}								
				var gridTheadTh = $("#configMaterialTable", $page).find("table thead th");
				var tr = "<tr id='"+andonConfig.andonCode+"' onclick='workJs._showconfigTrUre(this);'>";
				tr += "<td style='width:"+$(gridTheadTh[0]).width()+"px'><div><input name='mcodes'  type='checkbox'></div></td>";
				tr += "<td style='width:"+$(gridTheadTh[1]).width()+"px'><div>"+andonConfig.andonCode+"</div></td>";
				tr += "<td style='width:"+$(gridTheadTh[2]).width()+"px'><div>"+andonConfig.andonText+"</div></td>";
				tr += "<td style='width:"+$(gridTheadTh[3]).width()+"px'><div>"+andonConfig.materialCode+"</div></td>";
				tr += "<td style='width:"+$(gridTheadTh[4]).width()+"px'><div>"+andonConfig.materialText+"</div></td>";
				if(andonConfig.memo){
					tr += "<td style='width:"+$(gridTheadTh[5]).width()+"px'><div>"+andonConfig.memo+"</div></td>";
				}else{
					tr += "<td style='width:"+$(gridTheadTh[5]).width()+"px'><div></div></td>";
				}					
				$("#configMaterialTable .gridTbody", $page).find("table tbody").append(tr);					
			}					
		},
		_changeconfigUre : function(){
			if(andonCode){				
				var andonConfigUre = andonConfigMap.get(andonCode);
				if($("input[name='triggerMateriaLreqFlag']",$page).attr("checked")){
					andonConfigUre.triggerMateriaLreqFlag=1;
				}else{
					andonConfigUre.triggerMateriaLreqFlag=0;
				}
				if($("input[name='usemmConfigFlag']",$page).attr("checked")){
					andonConfigUre.usemmConfigFlag=1;
				}else{
					andonConfigUre.usemmConfigFlag=0;
				}
				if($("input[name='notify1Flag']",$page).attr("checked")){
					andonConfigUre.notify1Flag=1;
				}else{
					andonConfigUre.notify1Flag=0;
				}
				if($("input[name='notify2Flag']",$page).attr("checked")){
					andonConfigUre.notify2Flag=1;
				}else{
					andonConfigUre.notify2Flag=0;
				}
				if($("input[name='notify3Flag']",$page).attr("checked")){
					andonConfigUre.notify3Flag=1;
				}else{
					andonConfigUre.notify3Flag=0;
				}
				if($("input[name='notify4Flag']",$page).attr("checked")){
					andonConfigUre.notify4Flag=1;
				}else{
					andonConfigUre.notify4Flag=0;
				}
				if($("input[name='notify5Flag']",$page).attr("checked")){
					andonConfigUre.notify5Flag=1;
				}else{
					andonConfigUre.notify5Flag=0;
				}
				andonConfigUre.reqType=$("input[name='reqType']",$page).val();
				andonConfigUre.reqQuantity=$("input[name='reqQuantity']",$page).val();
				andonConfigUre.notify1Time=$("input[name='notify1Time']",$page).val();
				andonConfigUre.notify1Messagecode=$("input[name='notify1Messagecode']",$page).val();
				andonConfigUre.notify2Time=$("input[name='notify2Time']",$page).val();
				andonConfigUre.notify2Messagecode=$("input[name='notify2Messagecode']",$page).val();
				andonConfigUre.notify3Time=$("input[name='notify3Time']",$page).val();
				andonConfigUre.notify3Messagecode=$("input[name='notify3Messagecode']",$page).val();
				andonConfigUre.notify4Time=$("input[name='notify4Time']",$page).val();
				andonConfigUre.notify4Messagecode=$("input[name='notify4Messagecode']",$page).val();
				andonConfigUre.notify5Time=$("input[name='notify5Time']",$page).val();
				andonConfigUre.notify5Messagecode=$("input[name='notify5Messagecode']",$page).val();				
				andonConfigMap.put(andonCode,andonConfigUre);
			};				
		},
		_showconfigTrUre : function(_this){
			workJs._changeconfigUre();
			andonCode=$(_this).attr("id");
			workJs._clearconfigUre();
			workJs._showconfigUre(andonCode);
		},
		_showconfigUre : function(key){
			var andonConfigUre = andonConfigMap.get(key);	
			$("input[name='triggerMateriaLreqFlag']",$page).attr("checked", Boolean(andonConfigUre.triggerMateriaLreqFlag));
			$("input[name='usemmConfigFlag']",$page).attr("checked", Boolean(andonConfigUre.usemmConfigFlag));				
			$("input[name='notify1Flag']",$page).attr("checked", Boolean(andonConfigUre.notify1Flag));
			$("input[name='notify2Flag']",$page).attr("checked", Boolean(andonConfigUre.notify2Flag));
			$("input[name='notify3Flag']",$page).attr("checked", Boolean(andonConfigUre.notify3Flag));
			$("input[name='notify4Flag']",$page).attr("checked", Boolean(andonConfigUre.notify4Flag));
			$("input[name='notify5Flag']",$page).attr("checked", Boolean(andonConfigUre.notify5Flag));
			$("input[name='reqType']",$page).val(andonConfigUre.reqType);
			$("input[name='reqQuantity']",$page).val(andonConfigUre.reqQuantity);
			$("input[name='notify1Time']",$page).val(andonConfigUre.notify1Time);
			$("input[name='notify1Messagecode']",$page).val(andonConfigUre.notify1Messagecode);
			$("input[name='notify2Time']",$page).val(andonConfigUre.notify2Time);
			$("input[name='notify2Messagecode']",$page).val(andonConfigUre.notify2Messagecode);
			$("input[name='notify3Time']",$page).val(andonConfigUre.notify3Time);
			$("input[name='notify3Messagecode']",$page).val(andonConfigUre.notify3Messagecode);
			$("input[name='notify4Time']",$page).val(andonConfigUre.notify4Time);
			$("input[name='notify4Messagecode']",$page).val(andonConfigUre.notify4Messagecode);
			$("input[name='notify5Time']",$page).val(andonConfigUre.notify5Time);
			$("input[name='notify5Messagecode']",$page).val(andonConfigUre.notify5Messagecode);
		},
		_clearconfigUre : function(){
			$("input[name='triggerMateriaLreqFlag']",$page).attr("checked", false);
			$("input[name='usemmConfigFlag']",$page).attr("checked", false);				
			$("input[name='notify1Flag']",$page).attr("checked", false);
			$("input[name='notify2Flag']",$page).attr("checked", false);
			$("input[name='notify3Flag']",$page).attr("checked", false);
			$("input[name='notify4Flag']",$page).attr("checked", false);
			$("input[name='notify5Flag']",$page).attr("checked", false);
			$("input[name='reqType']",$page).val("");
			$("input[name='reqQuantity']",$page).val("");
			$("input[name='notify1Time']",$page).val("");
			$("input[name='notify1Messagecode']",$page).val("");
			$("input[name='notify2Time']",$page).val("");
			$("input[name='notify2Messagecode']",$page).val("");
			$("input[name='notify3Time']",$page).val("");
			$("input[name='notify3Messagecode']",$page).val("");
			$("input[name='notify4Time']",$page).val("");
			$("input[name='notify4Messagecode']",$page).val("");
			$("input[name='notify5Time']",$page).val("");
			$("input[name='notify5Messagecode']",$page).val("");
		},
		_addToMaterial : function(){			
			$('#materialTable').find("tbody tr").each(function(){	
				var tds=$(this).find('td');
				andonConfig = new Object();
				if(tds.eq(0).find("input").attr("checked")){
					andonConfig.andonCode=tds.eq(1).text();
					andonConfig.andonText=tds.eq(2).text();
					andonConfig.materialCode=tds.eq(3).text();
					andonConfig.materialText=tds.eq(4).text();
					andonConfig.memo=tds.eq(5).text();						
					if(!andonConfigMap.containsKey(andonConfig.andonCode)){
						andonConfigMap.put(andonConfig.andonCode,andonConfig); 
					}					 					
				}
		    });
			workJs._clear();
			workJs._addconfigMaterialTable();
		},
		_showMaterial : function(_this){
			workJs._cancelSelect();	 
			$("#materialTable .gridTbody", $page).find("table tbody").html("");
			var _code = $(_this).attr("id");		
			if(_code){
				$.DWZajax({
	                url:hostUrl +"/andonConfig/getMaterialCodeByAndonType",
	                data:{'code':_code},
	                callback:function(data){
	                    if(data && data.length > 0){
	                    	for(var i=0; i<data.length; i++){
	                    		workJs._addMaterialTable(data[i]);	 
	                        }
	                    }
	                }
	            });
			}
		},	
		_addMaterialTable : function(data){
			if(!data)
                return;			
			var gridTheadTh = $("#materialTable", $page).find("table thead th");			
			var tr = "<tr id='"+data.andonCode+"'>";
			tr += "<td style='width:"+$(gridTheadTh[0]).width()+"px'><div><input name='codes' value="+data.andonCode+" type='checkbox'></div></td>";
			tr += "<td style='width:"+$(gridTheadTh[1]).width()+"px'><div>"+data.andonCode+"</div></td>";
			tr += "<td style='width:"+$(gridTheadTh[2]).width()+"px'><div>"+data.andonText+"</div></td>";
			tr += "<td style='width:"+$(gridTheadTh[3]).width()+"px'><div>"+data.materialCode+"</div></td>";
			tr += "<td style='width:"+$(gridTheadTh[4]).width()+"px'><div>"+data.materialText+"</div></td>";
			if(data.memo){
				tr += "<td style='width:"+$(gridTheadTh[5]).width()+"px'><div>"+data.memo+"</div></td>";
			}else{
				tr += "<td style='width:"+$(gridTheadTh[5]).width()+"px'><div></div></td>";
			}
			$("#materialTable .gridTbody", $page).find("table tbody").append(tr);			
		},
		_cancelSelect : function(){	
			$("[name='quanxuan']").removeAttr("checked");
			$("[name='codes']").removeAttr("checked");			
		},
		_deleteMaterial : function(){    		
			$('#configMaterialTable').find("tbody tr").each(function(){					
				if($(this).find('td').eq(0).find("input").attr("checked")){
					andonConfigMap.remove($(this).find('td').eq(1).text());					
				}
		    });			
			workJs._clear();				
			workJs._addconfigMaterialTable();
		},
		_clear : function(){    		
			$("#configMaterialTable .gridTbody", $page).find("table tbody").html("");
			andonCode="";
			workJs._clearconfigUre();
		},
		_clearAll : function(){    		
			andonConfigMap.clear();
			workJs._clear();
		}
	}
</script>